<template>
    <div id="p_ad">
        <router-link :to="{path:'/m_mine'}">
            <img src="/static/z39h5/images/guide/ad.jpg" alt="" />
        </router-link>
        <router-link :to="{path:'/m_index'}">
            <div class="close-ad">
                跳过广告 <span><countdown slot="value" v-model="time" @on-finish="finish" v-show="show"></countdown></span>
            </div>
        </router-link>
    </div>
</template>
<script>
import {
    Countdown
} from 'vux'

export default {
    components: {
        Countdown
    },
    mounted: function() {

    },
    updated: function() {

    },
    methods: {
        finish(index) {
            this.show = false
            this.go('m_index');
            console.log('current index', index)
        }
    },
    data() {
        return {
            show: true,
            time: 5
        }
    }
}
</script>
<style scoped>


#p_ad,
#p_ad img {
    width: 100%;
    height: 100%;
    max-width: 100%;
}

.close-ad {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, .3);
    color: #fff;
    border-radius: 5px;
    font-size: 14px;
    padding: 2px 8px;
}
</style>
